/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.max.oti.system.bean.sppp;

import com.max.oti.system.model.Practice;
import com.max.oti.system.util.report.AbstractReportBean;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author max
 */
@ManagedBean
@SessionScoped
public class PracticeDetailBean extends AbstractReportBean implements Serializable {
    
    private Practice practice;
    private String year = "AÑO DE LA CONSOLIDACIÓN ECONOMICA Y SOCIAL DEL PERÚ";
    private boolean showStatePratice;
    
    @PostConstruct
    public void initCollections() {
        
    }

    public Practice getPractice() {
        return practice;
    }

    public void setPractice(Practice practice) {
        this.practice = practice;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public boolean isShowStatePratice() {
        return showStatePratice;
    }

    public void setShowStatePratice(boolean showStatePratice) {
        this.showStatePratice = showStatePratice;
    }


    /***************************PARA REPORTE ES NECESTIO ESTO***************************/
    private final String COMPILE_FILE_NAME = "rpt_authorization_practice_adviser";
 
    @Override
    protected String getCompileFileName() {
        return COMPILE_FILE_NAME;
    }
 
    @Override
    protected Map<String, Object> getReportParameters() {
        Map<String, Object> reportParameters = new HashMap<String, Object>();
        
        reportParameters.put("decano", practice.getIdAdviserPractice().getNameDoyen());
        reportParameters.put("unas", this.getClass().getResourceAsStream("/com/max/oti/system/util/image/unas.png"));
        reportParameters.put("fiis", this.getClass().getResourceAsStream("/com/max/oti/system/util/image/fiis.png"));
        reportParameters.put("code_alumn", practice.getCodeAlumn());
        reportParameters.put("name_year", year);
 
        return reportParameters;
    }
 
    public String execute() {
        try {
            super.prepareReport();
        } catch (Exception e) {
            // make your own exception handling
            e.printStackTrace();
        }
 
        return null;
    }
    /******************************************************/
    
    
}
